
<template>
  <div>
     <el-dialog  :visible.sync="imageDialogModel.show" >
                        <img width="100%" :src="imageDialogModel.imageUrl" alt="">
                    </el-dialog>

    <!-- userIdList.length > 0 &&$store.getters.getModel.seniorMall === 'true'
    $store.getters.getModel.memberAudit === 'true'
    $store.getters.getModel.seniorMall === 'true'
     -->
    <el-button @click="changeModel" type="primary" :disabled="userIdList.length==0" v-if="$store.getters.getModel.seniorMall ==='true' && ($store.getters.getRoleTpye === 'admin' || handelUpdateRole(27))" size="small">修改</el-button>
    <el-button @click="statusModel=!statusModel" type="primary" :disabled="userIdList.length==0" v-if="$store.getters.getModel.memberAudit === 'true' && ($store.getters.getRoleTpye === 'admin' ||handelUpdateRole(28))" size="small">审核</el-button>
    <el-button @click="handleChangeModel();" type="primary" size="small">注册会员</el-button>
   
    <div style="float:right;padding:0 110px;">
        <el-input placeholder="会员搜索" v-model="form.loginName" class="input-with-select">
    <el-button slot="append" type="primary" size="mini" @click="search()">搜索</el-button>
  </el-input>
    </div>

    <el-dialog  :visible.sync="viewBig" width="400px">
      <img :src="bigIcon" style="width:400px;height:400px;margin:-55px -20px -40px" >
    </el-dialog>

    <el-table ref="multipleTable"
      :data="userTableData"
      style="width: 100%" 
      @selection-change="setKeyIds"
      size='mini' v-if="$store.getters.getRoleTpye === 'admin' ||handelUpdateRole(25)">
      <el-table-column type="selection" width="50" align="center" v-if="$store.getters.getModel.seniorMall ==='true' && ($store.getters.getRoleTpye === 'admin' || handelUpdateRole(27)) ||$store.getters.getModel.memberAudit === 'true' && ($store.getters.getRoleTpye === 'admin' ||handelUpdateRole(28)) "></el-table-column>

      <el-table-column prop="name" label="头像">
        <template scope="scope" >
          <el-button type="text" v-popover:viewIcon>
            <img :src="scope.row.iconUrl" style="width:40px;height:40px;margin:-15px 0px" @click="viewBigIcon(scope.row.iconUrl)" >
          </el-button>
        </template>
      </el-table-column>
      <el-table-column label="手机号">
        <template scope="scope">
          <span>{{ scope.row.loginName}}</span>
        </template>
      </el-table-column>
      <el-table-column  prop="nickName" label="昵称"></el-table-column>
      <el-table-column  prop="companyName" label="公司名称"></el-table-column>
      <el-table-column  prop="companyAddress" label="公司地址"></el-table-column>
      <el-table-column label="用户角色">
        <template scope="scope">
          <span>{{ handleRole(scope.row.role)}}</span>
        </template>
      </el-table-column>

      <!-- <el-table-column prop="contactMobile" label="联系号码"></el-table-column> -->

      <el-table-column prop="name" label="用户类型" v-if=" $store.getters.getModel.seniorMall === 'true'">
        <template scope="scope">
          <span>{{ handleType(scope.row.userType)}}</span>
        </template>
      </el-table-column>
      <!-- OWNER,  //车主
        AGENT,  //代理商
        STAR3,  //3星用户
        STAR4,  //4星用户
        STAR5   //5星用户 -->
      <el-table-column prop="name" label="状态">
        <template scope="scope">
          <span>{{handleStatus(scope.row.userStatus)}}</span>
        </template>
      </el-table-column>
      <el-table-column prop="createTime" label="创建时间"></el-table-column>
      <el-table-column label="操作" width="300">
        <template scope="scope">
          <el-button size="small" @click="queryMoneyModel(scope.row)" v-if="$store.getters.getRoleTpye === 'admin' ||handelUpdateRole(29)">消费记录</el-button>
          <!-- <el-button :type="scope.row.blockStatus?'primary' :'info'" size="small" plain="" @click="doblockStatus(scope.row)">{{scope.row.blockStatus?'开通' :'冻结'}}</el-button> -->
          <el-button size="small" @click="queryRecordList(scope.row)" v-if="($store.getters.getRoleTpye === 'admin' ||handelUpdateRole(30)) && $store.getters.getModel.maintenanceUpload === 'true'">维修记录</el-button>
          
        </template>
      </el-table-column>
    </el-table>




 <div class="block" align="right" v-if="$store.getters.getRoleTpye === 'admin' ||handelUpdateRole(25)">
                    <br>
                    <el-pagination @current-change="handleCurrentChange" layout=" prev, pager, next" :total="count">
                    </el-pagination>
                </div>


  <el-dialog title="注册会员" :visible.sync="addModel" style="padding:20px 100px" center top="10vh" :close-on-click-modal='false' >
   


 <el-form label-width="100px"  ref="recordForm" :model="userForm">
    <el-form-item label="登录手机号" prop="loginName">
  <el-input placeholder="登录手机号" v-model="userForm.loginName" style="width:200px" maxlength="11">
  </el-input>
        </el-form-item>
  <div style="color:red;margin:0 20px 20px">默认密码为手机号后6位</div>

  <el-form-item label="用户类型" prop="role" v-if="!qds_flag">
      <el-select v-model="userForm.role" placeholder="请选择用户类型" v-if="!liyangDatasource">
	      <el-option label="车主"  value="OWNER"></el-option>
	      <el-option label="配件商" value="PARTS"></el-option>
	      <el-option label="修理厂" value="REPAIR"></el-option>
    	</el-select>
    	<el-select v-model="userForm.role" placeholder="请选择用户类型" v-else>
	      <el-option label="车主"  value="OWNER"></el-option>
	      <el-option label="代理" value="PARTS"></el-option>
	      <el-option label="维修厂" value="REPAIR"></el-option>
    	</el-select>
  </el-form-item>
  <el-form-item label="用户类型" prop="role" v-if="qds_flag">
      
    	<el-select v-model="userForm.role" placeholder="请选择用户类型" >
	      <el-option label="车主"  value="OWNER"></el-option>
	      <el-option label="代理" value="PARTS"></el-option>
	      <el-option label="服务商" value="REPAIR"></el-option>
	      <el-option label="技师" value="REPAIRMAN"></el-option>
    	</el-select>
  </el-form-item>


 </el-form>
<span slot="footer" class="dialog-footer">
              <el-button @click="addModel=false">取消</el-button>
              <el-button type="primary" @click="addUserSave();">一键注册</el-button>
            </span>
    </el-dialog>


    <el-dialog title="车型选择" :visible.sync="seleceCarModel" style="padding:20px 100px" center top="10vh" :close-on-click-modal='false' custom-class="custom">
  <div class='carBar' >
  <div class="carBar-items lineTwo " :class="carTabId==='1'&& !defauCarId ?'carBar-items_select':''" style="width:25%"  @click="changeTabrId('1')" >
    <span class='textFont'>{{brand}}</span>
  </div>
  <div class="carBar-items lineTwo " :class="carTabId==='2'&& !defauCarId ?'carBar-items_select':''" style="width:25%;border-left: solid  1px #e5e5e5;" :style="tabrId==='2'&& !defauCarId ?'border-bottom: solid #fff 1px;':''" @click="changeTabrId('2')" >
    <span class='textFont'>{{series}}</span>
  </div>
  <div class="carBar-items lineTwo " :class="carTabId==='3'&& !defauCarId ?'carBar-items_select':''" style="flex:1;border-left: 1px solid #e5e5e5;" :style="tabrId==='3'&& !defauCarId ?'border-bottom: solid #fff 1px;':''" @click="changeTabrId('3')" >
    <span class='textFont'>{{automobile}}</span>
  </div>
</div>
<div v-if="carTabId=='1'">
      <div style="display:flex;flex-wrap: wrap;">
<div class="letter" style="padding:0 10px;" @click="changeInputBrandSelectAll()" :style="isSelectAll ?'color:#1973bf;background-color:#fff;border-color:#1973bf;':''">全部
</div><div v-for="(item,index) in bsmList"  @click="changeInputBrand(index)" >
  <div  class="letter" :style="!selectBrandList[index] &&!isSelectAll ?'color:#1973bf;background-color:#fff;border-color:#1973bf;':''">
  {{index}}  </div>

      </div>

      </div>


<div  style="height:700px;    overflow: auto;">
<div v-for="(item,index) in bsmList" v-if="!selectBrandList[index] ||isSelectAll">
    <div style="border-top:1px #e5e5e5 solid;border-bottom:1px #e5e5e5 solid;background-color:#f5f5f5;
color:#666;padding-left:15px;" :id="index">
        {{index}}
    </div>

    <div style="display:flex;flex-wrap: wrap;" >
<div v-for="(itemObj,indexObj) in item" class="letterBox" v-if="!selectBrandList[index] ||isSelectAll" style="text-align:center;border:solid 1px #e5e5e5;margin:5px;height:110px;width:110px;cursor:pointer" @click="selectBrand(itemObj)">
    <img :src="itemObj.icon"  style="width:70px;height:70px;"/>
    <div>{{itemObj.brandName}}</div>
</div>
</div>
</div>
</div>
</div>
 <div class="inputBox" v-if="carTabId=='2'">
  <el-input placeholder="快速搜索"  v-model="seriesFilterInput" @input="changeInputSeries()"></el-input>
</div>

<div v-if="carTabId=='2'"  style="display:flex;flex-wrap: wrap;height:800px;  align-content: baseline;  overflow: auto;">
<div v-for="(item,index) in bsmSeriesList" v-if="!item.hide" @click="selectSeries(item)" style="text-align:center;margin:5px;height:110px;width:110px;cursor:pointer">
   <img :src="item.icon"  style="width:70px;height:70px;"/>
    <div>{{item.seriesName}}</div>
</div>
</div>

<!-- display:flex;  -->
 <div class="inputBox" v-if="carTabId=='3'">
  <el-input placeholder="快速搜索"  v-model="modelFilterInput" @input="changeInputModel()"></el-input>
  </div>
<div v-if="carTabId=='3'" style="height:800px;   display:flex; overflow: auto;">
 
<div style="width:100px;" class="classify-container">
  <div v-for="(classify,activeindex) in bsmAutomobileList" wx:key="id" @click='classifySelete(activeindex)'  >
        <div v-for="(itemObj,idx) in classify"  class="classify " v-if="!classify[idx][classify[idx].length-1].count"  :class="classifySeleted==activeindex?'active':''" :style="classifySeleted==activeindex?'color:#1973bf;border-left:#1973bf 5px solid;':''"  >
          <div class="name">{{idx}} </div>
        </div>
      </div>

</div>

    <div class="goods-container" >
      <div v-for="(classify,index) in classifyContent" class="goods-container1" style="float:left">
        <div v-for="itemObj in classify"  class='contentBox' @click='selectAutomobile(itemObj)' style="padding:15px 0" v-if="!itemObj.hide" >
          <img :src='itemObj.icon'  style='  width: 100px;height: 72px;margin-right:5px' />
  
          <div style='flex:1;display: flex;align-items: center;'>
            <div>
              <div>
                <span style='color:#FD7D31'>   {{itemObj.engine}}</span>
                <span class='lineTwo'>   {{itemObj.modelName}}</span>
              </div>
             
              <div style='color:#1973bf;bottom:5px;' >
                参考价:￥
                <span style='margin-right:5px'>{{itemObj.price}}</span>万
              </div>
            </div>
          </div>
        </div>
  </div>
        </div>

</div>



    </el-dialog>



    <el-dialog :title="addOrEdit==='add'?'新增维修记录':'编辑维修记录'" :visible.sync="recordaddModel" style="padding:20px 100px" center top="10vh" :close-on-click-modal='false' custom-class="custom">
    <el-form label-width="100px" :rules="rules" ref="recordForm" :model="recordForm">
    <div style="padding:25px 27px 30px;    overflow: hidden;">
          <el-form-item label="车架号" prop="vin">
  <div style="width: 300px;">
  <el-input placeholder="请输入17位车架号" v-model="vin" :maxlength="17">
    <el-button slot="append" style="background-color:#1973bf;color:#fff;" @click="getCarByVin()">智能匹配</el-button>
  </el-input>
</div>
        </el-form-item>

 <el-form-item label="车型" prop="carId">
  <div style="display:flex;    align-items: center;">


<span v-if="selectCarItem.id">
    <div style="display:flex;margin-right:10px">
        <div>
          <img :src="selectCarItem.icon" alt="" style="width: 90px;
    height: 70px;
    margin: 0 10px;">
        </div>
       <div>
 <div>{{selectCarItem.brandName}}{{selectCarItem.seriesName}}</div>
        <div>{{selectCarItem.modelName}}</div>
       </div>
    </div>

</span>
<span v-else style="color:#999"><span>车架号识别</span><span style="margin:0 10px;">或</span></span>

<span style="text-decoration:underline;color: #1973bf;cursor:pointer" @click="selectCar()">手动选择</span>
</div>
        </el-form-item>



  <el-form-item label="车牌号" prop="carNumber">
  <el-input placeholder="请输入内容" v-model="recordForm.carNumber" style="width:200px">
  </el-input>
        </el-form-item>


<el-row :gutter="22">
<el-col :span="11">
  <el-form-item label="客户名称" prop="realName">
  <el-input placeholder="请输入内容" v-model="recordForm.realName" >
  </el-input>
        </el-form-item>
</el-col>
<el-col :span="11">

  <el-form-item label="联系方式" prop="contactMobile">
  <el-input placeholder="请输入内容" v-model="recordForm.contactMobile" style="width:180px">
  </el-input>
        </el-form-item>
</el-col>
</el-row>





<el-row :gutter="22">
<el-col :span="11">
  <el-form-item label="维修时间" prop="dataData">
    <el-col :span="11" style="padding-left:0">
      <el-date-picker  type="datetime" placeholder="选择日期" v-model="dataData" style="width: 270%;"></el-date-picker>
    </el-col>
  </el-form-item>
</el-col>
<el-col :span="11">
  <el-form-item label="维修里程" prop="maintenanceMileage">
  <el-input placeholder="请输入内容" v-model="recordForm.maintenanceMileage" style="width:180px">
    <template slot="append">公里</template>
  </el-input>
        </el-form-item>
</el-col>

</el-row>
  

<el-row :gutter="22">
<el-col :span="11">
  <el-form-item label="维修企业"  prop="maintenanceShop">
  <el-input placeholder="请输入内容" v-model="recordForm.maintenanceShop" >
  </el-input>
        </el-form-item>
</el-col>
<el-col :span="11">

  <el-form-item label="维修技师" prop="maintenanceWorker">
  <el-input placeholder="请输入内容" v-model="recordForm.maintenanceWorker" style="width:180px">
  </el-input>
        </el-form-item>
</el-col>
</el-row>
<el-row :gutter="22">
<el-col :span="11">

 <el-form-item label="维修类型" prop="maintenanceType">
    <el-select v-model="recordForm.maintenanceType" placeholder="请选择活动区域">
      <el-option label="保养"  value="KEEP"></el-option>
      <el-option label="维修" value="MAINTAIN"></el-option>
      <!-- <el-option label="事故" value="ACCIDENT"></el-option>
      <el-option label="其他" value="OTHER"></el-option> -->
    </el-select>
  </el-form-item>
  </el-col>
<el-col :span="11">
  <el-form-item label="维修费用" prop="maintenanceFee">
  <el-input placeholder="请输入内容" v-model="recordForm.maintenanceFee" style="width:180px">
    <template slot="append">元</template>
  </el-input>
        </el-form-item>
</el-col>
</el-row>
  





          <el-form-item label="支付方式" prop="payType">
  <el-select v-model="recordForm.payType" placeholder="请选择活动区域">
      <el-option label="微信"  value="WECHAT_PAY"></el-option>
      <el-option label="支付宝" value="ALI_PAY"></el-option>
      <el-option label="现金" value="OFFLINE_PAY"></el-option>
      <el-option label="其他" value="OTHER"></el-option>
    </el-select>
 <el-input v-if="recordForm.payType == 'OTHER'" :disabled="recordForm.payType != 'OTHER'" placeholder="请输入内容" v-model="recordForm.otherName"  style="width:100px;margin:0 20px">
  </el-input>

    <!-- <el-radio-group v-model="recordForm.payType">
      <el-radio label="WECHAT_PAY" >微信</el-radio>
      <el-radio label="ALI_PAY" >支付宝</el-radio>
      <el-radio label="OFFLINE_PAY" >现金</el-radio>
      <el-radio label="OTHER" >其他</el-radio>
    </el-radio-group> -->


  </el-form-item>
  <el-form-item label="维修内容" prop="maintenanceContent">
    <el-input type="textarea" v-model="recordForm.maintenanceContent"></el-input>
  </el-form-item>


  <!-- MAINTAIN,//维修
    KEEP,//保养
    ACCIDENT,//事故
    OTHER //其他 -->
  


  <el-form-item label="维修图片" v-loading="loadding">
<!-- el-upload-list__item-actions -->

<div style="    display: flex;
    align-items: center;
    flex-wrap: wrap;">

<div v-for="(item,index) in 8" style=" display: flex;
    align-items: center;
    flex-wrap: wrap;">

<span style="color:red" :style="index<4?'':'visibility: hidden;'" >*</span>

<div class="el-upload el-upload--picture-card" style="margin:5px;" @click="handleUpload(index)">
               
               <img v-if="uploadModel.fileList[index]" :src="uploadModel.fileList[index].url" style="    width: 100%;
    height: 100%;"/>
               <span v-else>{{formatImageText(index)}}</span>
</div>
<input style="display:none" type="file" :ref="'file'+index" name="" id="" @change="handleCurrentFile(index);"/>
</div>

</div>


 <!-- <el-upload :action="uploadModel.uploadUrl" list-type="picture-card" 
                 :on-preview="uploadModel.onPreview" 
                :on-remove="uploadModel.onRemove" 
                :on-success="uploadModel.onUploadSuccess" 
                :file-list="uploadModel.fileList"
                   :on-progress="uploadModel.progress"
                :on-error="uploadModel.error"
                 :before-upload="uploadModel.onBefore" 
               ref="uploadcommont">
                    <i class="el-icon-plus"></i>
                </el-upload> -->
  </el-form-item>

          <el-form-item label="编辑人" prop="entryClerk">
  <el-input placeholder="请输入内容" v-model="recordForm.entryClerk" style="width:180px">
  </el-input>
        </el-form-item>
    </div>

<div style="    background-color: rgb(37, 155, 36);
    color: rgb(255, 255, 255);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;background-color:#259b24;color:#fff;cursor:pointer" @click="submitForm('recordForm')"  v-loading="loadding">
  
    <span>{{addOrEdit==='add'?'确认提交':'保存修改'}}</span>
</div>
    </el-form>
    </el-dialog>

<el-dialog  :visible.sync="vinresultlist" title="VIN查询结果">

    <el-table
      :data="vinresultList"
      style="width: 100%">
      <el-table-column
        label="车型"
        width="200">
           <template scope="scope">
<span>{{scope.row.brand}} {{scope.row.series}}     {{scope.row.model}}</span>
          </template>
      </el-table-column>
      <el-table-column
        label="图片">
    <template scope="scope">
<span><img :src="scope.row.pic" style="width:100px;"/></span>
          </template>
      </el-table-column>

     <el-table-column label="操作" width="300">
        <template scope="scope">
          <el-button  style="font-size:20px" @click="selectCarByVin(scope.row)">选择</el-button>
        </template>
      </el-table-column>

      
    </el-table>
</el-dialog>


    <el-dialog  :visible.sync="recordModel" style="padding:20px 100px;overflow: hidden;" center top="10vh" width="90%"  :close-on-click-modal='false' >
       <div style="text-align: center;">
 <el-button style="background-color:#1973bf;color:#fff;float:left" @click="doInsertRecord()" v-if="($store.getters.getRoleTpye === 'admin' ||handelUpdateRole(31)) && $store.getters.getModel.maintenanceUpload === 'true'">新增</el-button>
        <div class="el-dialog__title" style="height:40px;display: flex;
    align-items: center;
    justify-content: center;"><span>维修记录</span></div>
    <div style="height:620px;     width: 100%;   overflow: auto;">
<el-table
      :data="recordList"
      style="width: 100%">

   <el-table-column  label="类型">
          <template scope="scope">
<span :style="formatMaintenanceTypeColor(scope.row.maintenanceType)">{{formatMaintenanceType(scope.row.maintenanceType)}}</span>
          </template>
        </el-table-column>



   <el-table-column  label="车型/车架号" width="200px" >
          <template scope="scope">
<div>
  {{scope.row.carName}}
</div>
<div>
  {{scope.row.vin}}
</div>
          </template>
        </el-table-column>




   <el-table-column  label="车牌号">
          <template scope="scope">
<span>{{scope.row.carNumber}}</span>
          </template>
        </el-table-column>






   <el-table-column  label="维修里程">
          <template scope="scope">
<span>{{scope.row.maintenanceMileage}}公里</span>
          </template>
        </el-table-column>


   <el-table-column  label="维修费用">
          <template scope="scope">
<span>￥{{scope.row.maintenanceFee}}</span>
          </template>
        </el-table-column>

   <el-table-column  label="维修照片" width="100px">
          <template scope="scope">
<span><img :src="scope.row.maintenanceImg.split(',')[0]" v-if="scope.row.maintenanceImg.split(',')[0]"  style="width:70px;cursor: pointer;" @click="showImage(scope.row.maintenanceImg.split(','))"/></span>
          </template>
        </el-table-column>

 <el-table-column  label="维修内容" >
          <template scope="scope">
<span>{{scope.row.maintenanceContent}}</span>
          </template>
        </el-table-column>

 <el-table-column  label="维修时间">
          <template scope="scope">
<span>{{scope.row.maintenanceDate}}</span>
          </template>
        </el-table-column>

     <el-table-column label="操作" width="300" v-if="($store.getters.getRoleTpye === 'admin' ||handelUpdateRole(32)) && $store.getters.getModel.maintenanceUpload === 'true'">
        <template scope="scope">
          <el-button type="text" icon="el-icon-edit" style="font-size:20px" @click="editMaintenanceItem(scope.row)"></el-button>
        </template>
      </el-table-column>



    </el-table>


    </div>
       </div>
       <div class="block" align="right">
                    <br>
                    <el-pagination @current-change="handleCurrentTranChangeRecord" layout=" prev, pager, next" :total="recordPageCount">
                    </el-pagination>
                </div>
    </el-dialog>



    <el-dialog title="消费记录" :visible.sync="moneyModel" style="padding:20px 100px" center top="10vh" :close-on-click-modal='false' >
      <el-table :data="tableData" style="width: 100%" height="500">
        <el-table-column prop="orderId" label="订单号" ></el-table-column>
        <el-table-column prop="payTransactionId" label="流水号"></el-table-column>
        
        <el-table-column prop="money" label="金额"></el-table-column>
        <el-table-column prop="name" label="类型">
          <template scope="scope">
            <span>{{ scope.row.transactionType === 'PAY' ?"支付":'退款'}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="name" label="途径">
          <template scope="scope">
            <span>{{ scope.row.transactionWay === 'WECHAT_PAY' ?"微信支付":'支付宝支付'}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="时间"></el-table-column>

      <el-table-column label="操作" width="300">
        <template scope="scope">
          <el-button size="small" @click="$router.push({path:'/orderindex',query:{orderId:scope.row.orderId}})">查看订单</el-button>
        </template>
      </el-table-column>


      </el-table>

       <div class="block" align="right">
                    <br>
                    <el-pagination @current-change="handleCurrentTranChange" layout=" prev, pager, next" :total="tranCount">
                    </el-pagination>
                </div>

    </el-dialog>

    <el-dialog title="批量修改" :visible.sync="editModel" style="padding:20px 100px" center top="10vh" :close-on-click-modal='false' >
      <el-form label-width="100px">
    
    <el-row :gutter="22">
        <el-col :span="12">
            <el-form-item label="用户等级">
                    <el-select v-model="form.userStar" placeholder="请选择活动区域">
      <el-option :label="handleLabel(1)" value="STAR1"></el-option>
      <el-option :label="handleLabel(2)" value="STAR2"></el-option>
      <el-option :label="handleLabel(3)" value="STAR3"></el-option>
      <!--<el-option :label="handleLabel(4)" value="STAR4"></el-option>
      <el-option :label="handleLabel(5)" value="STAR5"></el-option>-->
    </el-select>
            </el-form-item>
        </el-col>
    </el-row>
      </el-form>  

  <span slot="footer" class="dialog-footer">
              <el-button @click="editModel=false">取消</el-button>
              <el-button type="primary" @click="save">确定</el-button>
            </span>
 </el-dialog>


 <el-dialog title="批量审核" :visible.sync="statusModel" style="padding:20px 100px" center width="500" top="10vh" :close-on-click-modal='false'>
      <el-form label-width="100px">
    
    <el-row :gutter="24">
        <el-col :span="12">
            <el-form-item label="用户状态">
                    <el-select v-model="statusForm.userStatus" placeholder="请选择用户状态">
      <el-option label="冻结" value="USER_CHECK_FAILED"></el-option>
      <el-option label="审核成功" value="USER_CHECK_SUCCEED"></el-option>
    </el-select>
            </el-form-item>
        </el-col>
    </el-row>

      </el-form>  

  <span slot="footer" class="dialog-footer">
              <el-button @click="statusModel=false">取消</el-button>
              <el-button type="primary" @click="saveStatus">确定</el-button>
            </span>
 </el-dialog>

     <el-dialog  :visible.sync="carouselModel" :center="true">
 <el-carousel trigger="click"   height="700px"  :autoplay="false" >
      <el-carousel-item v-for="item in carouselList" :key="item">
     <div style="width:100%;height:100%;    display: flex;
    justify-content: center;
    align-items: center;">
        <img :src="item" style="width:100%;" />
</div>
      </el-carousel-item>
    </el-carousel>
                    </el-dialog>


   </div>
</template>

<script>
import * as Api from "@/api/Api.js";
import * as RoundApi from "@/api/RoundApi.js";
import * as Config from "@/api/Config.js";

export default {
  data() {
    let vin = (rule, value, callback) => {
      if ((this.vin || "") === "" || this.vin.length != 17) {
        callback(new Error("请输入17位vin码"));
      }
      callback();
    };
    let realName = (rule, value, callback) => {
      if ((this.recordForm.realName || "") === "") {
        callback(new Error("请输入客户名称"));
      }
      callback();
    };
    let carNumber = (rule, value, callback) => {
      1;
      if ((this.recordForm.carNumber || "") === "") {
        callback(new Error("请输入车牌号"));
      }
      callback();
    };
    let contactMobile = (rule, value, callback) => {
      if ((this.recordForm.contactMobile || "") === "") {
        callback(new Error("请输入联系方式"));
      }
      callback();
    };

    let dataData = (rule, value, callback) => {
      if ((this.dataData || "") === "") {
        callback(new Error("请选择维修时间"));
      }
      callback();
    };
    let maintenanceMileage = (rule, value, callback) => {
      if ((this.recordForm.maintenanceMileage || "") === "") {
        callback(new Error("请选择维修里程"));
      }
      callback();
    };
    let maintenanceShop = (rule, value, callback) => {
      if ((this.recordForm.maintenanceShop || "") === "") {
        callback(new Error("请输入维修企业"));
      }
      callback();
    };
    let maintenanceWorker = (rule, value, callback) => {
      if ((this.recordForm.maintenanceWorker || "") === "") {
        callback(new Error("请输入维修技师"));
      }
      callback();
    };
    let maintenanceType = (rule, value, callback) => {
      if ((this.recordForm.maintenanceType || "") === "") {
        callback(new Error("请选择维修类型"));
      }
      callback();
    };
    let maintenanceFee = (rule, value, callback) => {
      if ((this.recordForm.maintenanceFee || "") === "") {
        callback(new Error("请输入维修费用"));
      }
      callback();
    };
    let maintenanceContent = (rule, value, callback) => {
      if ((this.recordForm.maintenanceContent || "") === "") {
        callback(new Error("请输入维修内容"));
      }
      callback();
    };
    let entryClerk = (rule, value, callback) => {
      if ((this.recordForm.entryClerk || "") === "") {
        callback(new Error("请输入编辑人"));
      }
      callback();
    };

    // recordForm
    return {
      rules: {
        vin: [{ required: true, validator: vin, trigger: "blur" }],
        realName: [{ required: true, validator: realName, trigger: "blur" }],
        carNumber: [{ required: true, validator: carNumber, trigger: "blur" }],
        contactMobile: [
          { required: true, validator: contactMobile, trigger: "blur" }
        ],
        dataData: [{ required: true, validator: dataData, trigger: "blur" }],
        maintenanceMileage: [
          { required: true, validator: maintenanceMileage, trigger: "blur" }
        ],
        maintenanceShop: [
          { required: true, validator: maintenanceShop, trigger: "blur" }
        ],
        maintenanceWorker: [
          { required: true, validator: maintenanceWorker, trigger: "blur" }
        ],
        maintenanceType: [
          { required: true, validator: maintenanceType, trigger: "blur" }
        ],
        maintenanceFee: [
          { required: true, validator: maintenanceFee, trigger: "blur" }
        ],
        maintenanceContent: [
          { required: true, validator: maintenanceContent, trigger: "blur" }
        ],
        entryClerk: [{ required: true, validator: entryClerk, trigger: "blur" }]
      },
      vinresultlist: false,
      cHeight: "0",
      
      carouselModel: false,
      carouselList: [],
      seriesFilterInput: "",
      modelFilterInput: "",
      selectBrandList: {},
      isSelectAll: true,
      addOrEdit: "add",
      imageDialogModel: {
        show: false,
        imageUrl: ""
      },
      loadding: false,
      vin: "",
      selectCarItem: {},
      classifySeleted: 0, //选中的年份上级节点的下标
      classifyContent: [],
      carTabId: "1",
      bsmList: [],
      bsmSeriesList: [],
      bsmAutomobileList: [],
      tabrId: "1",
      brand: "品牌",
      series: "车系",
      automobile: "车型",
      seleceCarModel: false,
      uploadModel: {
        disabled: false,
        uploadUrl: "",
        fileList: [],
        onRemove: (file, fileList) => {
          console.log(file, this.uploadModel.fileList);
          console.log("删除", this.loadding);
          if (this.loadding) {
            this.loadding = false;
            return;
          }
          this.uploadModel.fileList = fileList;
        },
        onBefore: () => {
          if (this.loadding) {
            return false;
          }
        },
        onPreview: file => {
          this.imageDialogModel.imageUrl = file.url;
          this.imageDialogModel.show = true;
        },
        loadfun: res => {
          console.log(1, res);
          let dt = {
            name: "1.png",
            url: res.action
          };
          this.uploadModel.fileList.push(dt);
          console.log(this.uploadModel.fileList);
          this.loadding = false;
        },
        onUploadSuccess: (response, file, fileList) => {
          let dt = {
            name: "1.png",
            url: response.data.filename
          };
          window.myvue.uploadModel.fileList.push(dt);
          this.loadding = false;
        },
        error: () => {
          this.loadding = false;
        },
        progress: () => {
          this.loadding = true;
        },
        doPreview: () => {}
      },
      recordList: [],
      userId: "",
      recordModel: false,
      recordaddModel: false,
      tranCount: 0,
      tranPageIndex: 1,
      pageIndex: 1,
      count: 0,
      bigIcon: "",
      viewBig: false,
      tableData: [],
      moneyModelForm: {
        page: 0,
        pageSize: 10,
        userId: ""
      },
      moneyModel: false,
      statusModel: false,
      statusForm: {
        userStatus: "USER_CHECK_SUCCEED"
      },
      selectModel: false,
      priceModel: [],
      userTableData: [],
      userIdList: [],
      editModel: false,
      form: {
        pageSize: 10,
        page: 0,
        loginName: "",
        userStar: ""
      },
      dataData: "",
      qds_flag: false,
      recordForm: {
        userId: "",
        carId: "",
        carName: "",
        vin: "",
        realName: "",
        contactMobile: "",
        maintenanceContent: "",
        maintenanceImg: "",
        carNumber: "",
        maintenanceMileage: "",
        maintenanceFee: "",
        payType: "WECHAT_PAY",
        otherName: "",
        maintenanceType: "KEEP",
        maintenanceDate: "",
        maintenanceWorker: "",
        maintenanceShop: "",
        entryClerk: ""
      },
      recordPageCount: 0,
      recordPage: 0,
      addModel: false,
      userForm: {
        loginName: "",
        password: "",
        role: "OWNER"
      },
      repassword: "",
      liyangDatasource: false  // 是否是力洋
    };
  },

  methods: {
  	search() {
  		this.pageIndex = 1
  		this.getUserList()
  	},
    addUserSave() {
      var patrn = /^[0-9]*$/;
      if (
        !patrn.test(this.userForm.loginName) ||
        this.userForm.loginName.length != 11
      ) {
        this.$message("请输入正确的手机号码");
        return;
      }
      this.userForm.password = this.userForm.loginName.substring(5, 12);
      this.userForm.contactMobile = this.userForm.loginName;
      this.userForm.password = RoundApi.addUserSave(this, this.userForm).then(
        res => {
          console.log(res);
          if (res.retCode) {
            this.$message("添加成功");

            this.addModel = !this.addModel;

            this.getUserList();
          } else {
            this.$message(res.message);
            return;
          }
        }
      );
    },
    handleChangeModel() {
      this.addModel = !this.addModel;
    },
    handleCurrentTranChangeRecord(val) {
      console.log("维修记录分页");

      console.log(val);
      this.recordPage = val - 1;
      this.getRecordList();
    },
    handleCurrentFile(index) {
      let name = "file" + index;
      let form = new FormData();
      let logo = this.$refs[name][0].files[0];
      form.append("file", logo);
      this.loadding = true;

      RoundApi.upLoadPicture(form).then(res => {
        console.log("上传", res);

        if (res.retCode) {
          let dt = {
            name: "1.png",
            url: res.data.filename
          };
          this.uploadModel.fileList[index] = dt;
          this.loadding = false;
        }
      });
    },
    handleUpload(index) {
      let name = "file" + index;
      this.$refs[name][0].click();
    },
    formatImageText(index) {
      switch (index) {
        case 0:
          return "车店合一";
        case 1:
          return "技师和车";
        case 2:
          return "收款凭证";
        case 3:
          return "施工交付";
        default:
          return "施工现场";
      }
    },
    submitForm(formName) {
      console.log(this.$refs[formName]);
      this.$refs[formName].validate(valid => {
        if (valid) {
          this.handleMaintenance();
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
    selectCarByVin(row) {
      row.id = row.model_id;
      row.seriesName = row.brand + row.series;
      row.modelName = row.model;
      row.icon = row.pic;
      this.selectCarItem = row;
      this.vinresultlist = !this.vinresultlist;
    },
    showImage(image) {
      this.carouselModel = true;
      this.carouselList = image;
      // let carouselList = image
    },
    changeInputModel(e) {
      if (this.modelFilterInput === "") {
        //当空字符时还原
        this.bsmAutomobileList.forEach((item, brandIndex) => {
          for (let opt in item) {
            let count = false;

            item[opt].forEach((cat, catIndex, arr) => {
              if (cat.modelName) {
                this.classifyContent = this.bsmAutomobileList[
                  this.classifySeleted
                ];
                count = false;
                Object.assign(cat, { hide: count });
              } else {
                arr[catIndex] = {
                  hide: true,
                  count: count
                };
              }
            });
          }
        });
      } else {
        let initSelect = true;
        this.bsmAutomobileList.forEach((item, brandIndex) => {
          for (let opt in item) {
            let count = true;
            item[opt].forEach((cat, catIndex, arr) => {
              if (cat.modelName) {
                if (cat.modelName.indexOf(this.modelFilterInput) !== -1) {
                  //分组选择的时候  筛选   选中第一个结果的年份
                  if (initSelect) {
                    this.classifySeleted = brandIndex;
                    initSelect = false;
                  }
                  count = false;
                }
                Object.assign(cat, {
                  hide: cat.modelName.indexOf(this.modelFilterInput) === -1
                });
              } else {
                arr[catIndex] = {
                  hide: true,
                  count: count
                };
              }
            });

            if (item[opt][item[opt].length - 1].modelName) {
              item[opt][item[opt].length] = {
                hide: true,
                count: count
              };
            }
          }
        });
      }

      this.classifyContent = this.bsmAutomobileList[this.classifySeleted];
    },
    changeInputSeries() {
      let bsmSeriesList = {};
      Object.assign(bsmSeriesList, this.bsmSeriesList);
      for (let n in bsmSeriesList) {
        Object.assign(bsmSeriesList[n], {
          hide:
            bsmSeriesList[n].seriesName.indexOf(this.seriesFilterInput) === -1
        });
      }

      this.bsmSeriesList = bsmSeriesList;
    },

    removeByValue(arr, val) {
      for (var i = 0; i < arr.length; i++) {
        if (arr[i] == val) {
          arr.splice(i, 1);
          break;
        }
      }
    },
    changeInputBrandSelectAll() {
      if (this.isSelectAll) {
        return false;
      }
      let selectBrandList = {};
      Object.assign(selectBrandList, this.selectBrandList);
      for (let n in selectBrandList) {
        this.isSelectAll
          ? (selectBrandList[n] = false)
          : (selectBrandList[n] = true);
      }
      this.isSelectAll = !this.isSelectAll;
      this.selectBrandList = selectBrandList;
    },
    changeInputBrand(index) {
      let selectBrandList = {};
      Object.assign(selectBrandList, this.selectBrandList);
      let selectAllStatus = true;
      let count = !selectBrandList[index];
      for (let n in selectBrandList) {
        if (n === index) {
          selectBrandList[n]
            ? (selectBrandList[n] = false)
            : (selectBrandList[n] = true);
        }
        count != selectBrandList[n] ? (selectAllStatus = false) : "";
      }
      this.isSelectAll = selectAllStatus;
      this.selectBrandList = selectBrandList;
    },
    doInsertRecord() {
      this.vin = "";
      this.selectCarItem = {};
      this.dataData = "";
      this.uploadModel.fileList = [];
      this.addOrEdit = "edit";
      this.addOrEdit = "add";
      this.recordForm = {
        userId: "",
        carId: "",
        carName: "",
        vin: "",
        realName: "",
        contactMobile: "",
        maintenanceContent: "",
        maintenanceImg: "",
        carNumber: "",
        maintenanceMileage: "",
        maintenanceFee: "",
        payType: "WECHAT_PAY",
        otherName: "",
        maintenanceType: "KEEP",
        maintenanceDate: "",
        maintenanceWorker: "",
        maintenanceShop: "",
        entryClerk: ""
      };
      this.recordaddModel = !this.recordaddModel;
    },
    editMaintenanceItem(row) {
      var moment = require("moment");

      this.dataData = "";
      this.uploadModel.fileList = [];
      this.addOrEdit = "edit";
      //查询车辆信息
      let model = {
        modelId: row.carId
      };
      RoundApi.getModelItemByModelId(this, model).then(res => {
        if (res.retCode) {
          this.selectCarItem = res.data;
        } else {
        }
      });
      if ((row.maintenanceImg || "") !== "") {
        //图片
        let fileList = row.maintenanceImg.split(",");
        for (let i in fileList) {
          var dt = {
            name: "1.png",
            url: fileList[i]
          };
          this.uploadModel.fileList.push(dt);
        }
      }
      if (row.maintenanceDate) {
        this.dataData = row.maintenanceDate;
        // row.maintenanceDate.split(" ")[1]
      }

      this.recordaddModel = !this.recordaddModel;
      this.vin = row.vin;
      let recordForm = {};
      Object.assign(recordForm, row);
      this.recordForm = recordForm;

      return;
    },
    formatMaintenanceTypeColor(row) {
      switch (row) {
        case "MAINTAIN":
          return "color:#d9aa07";
        case "KEEP":
          return "color:#259b24";
        case "ACCIDENT":
          return "color:#e51c23";
        case "OTHER":
          return "color:#666666";
      }
    },
    formatMaintenanceType(row) {
      switch (row) {
        case "MAINTAIN":
          return "维修";
        case "KEEP":
          return "保养";
        case "ACCIDENT":
          return "事故";
        case "OTHER":
          return "其他";
      }
    },

    handleMaintenance() {
      if (!this.selectCarItem.id) {
        this.$message("请获取一款车型");
        return;
      }
      if (this.recordForm.carNumber === "") {
        this.$message("输入车牌号");
        return;
      }
      if (this.recordForm.maintenanceMileage === "") {
        this.$message("输入维修里程");
        return;
      }
      if (this.recordForm.maintenanceFee === "") {
        this.$message("输入维修费用");
        return;
      }
      for (let i = 0; i < 4; i++) {
        if (!this.uploadModel.fileList[i]) {
          let message = this.formatImageText(i);
          this.$message("请上传" + message + "图片");
          return;
        }
      }

      this.recordForm.maintenanceFee === "";
      var moment = require("moment");
      let model = {};
      Object.assign(model, this.recordForm);
      let imgList = [];
      this.uploadModel.fileList.forEach((item, index) => {
        imgList.push(item.url);
      });
      let date =
        moment(this.dataData).format("YYYY-MM-DD") +
        " " +
        moment(this.dataData).format("HH:mm:ss");
      model.maintenanceDate = date;

      model.maintenanceImg = imgList.join(",");
      model.vin = this.vin;
      model.carId = this.selectCarItem.id;

      if (this.addOrEdit === "add") {
        // console.log(moment(this.dataData).format("YYYY-MM-DD")
        //     + " "
        //     + moment(this.dataTime).format("HH:mm:ss"))

        // console.log(moment(this.dataData).format("YYYY-MM-DD")
        //     + " "
        //     + moment(this.dataTime).format("HH:mm:ss"))
        model.userId = this.userId;

        model.carName =
          this.selectCarItem.seriesName + this.selectCarItem.modelName;

        RoundApi.addRecord(this, model).then(res => {
          if (res.retCode) {
            console.log("新增维修记录", res.data);
            this.recordaddModel = !this.recordaddModel;
            this.getRecordList();
          } else {
          }
        });
      } else {
        RoundApi.updateRecord(this, model).then(res => {
          if (res.retCode) {
            console.log("修改维修记录", res.data);
            this.recordaddModel = !this.recordaddModel;
            this.getRecordList();
          } else {
          }
        });
      }
    },
    getCarByVin() {
      if (this.vin.length < 17) {
        return;
      }
      let model = {
        vin: this.vin
      };
      RoundApi.getCarByVin(this, model).then(res => {
        console.log(res);

        if (res.retCode) {
          if (res.data.length === 1) {
            res.data[0].id = res.data[0].model_id;
            res.data[0].seriesName = res.data[0].brand + res.data[0].series;
            res.data[0].modelName = res.data[0].model;
            res.data[0].icon = res.data[0].pic;
            this.selectCarItem = res.data[0];
          } else if (res.data.length > 1) {
            this.vinresultlist = !this.vinresultlist;
            this.vinresultList = res.data;

            this.$message("多个结果");
          } else {
            this.$message("没有结果");
          }
        } else {
          this.$message(res.message);
        }
      });
    },
    selectAutomobile(row) {
      console.log(row);
      this.selectCarItem = row;
      this.seleceCarModel = !this.seleceCarModel;
    },
    // 选择车型年份
    classifySelete(activeindex) {
      this.classifySeleted = activeindex;
      this.classifyContent = this.bsmAutomobileList[activeindex];
    },
    changeTabrId(e) {
      if ((e === "2" || e === "3") && e !== "1" && this.brand === "品牌") {
        this.$alert("请选择一款品牌");
        return;
      }
      if (e === "3" && this.series === "车系") {
        this.$alert("请选择一款车系");
        return;
      }

      this.carTabId = e;
    },
    selectSeries(row) {
      this.series = row.seriesName;
      this.carTabId = "3";
      this.getBsmList(row.brandId, row.id);
    },
    selectBrand(row) {
      this.brand = row.brandName;
      this.carTabId = "2";
      this.getBsmList(row.id);
    },
    selectCar() {
      this.carTabId = "1";
      this.seleceCarModel = !this.seleceCarModel;
      this.getBsmList();
    },
    getBsmList(...args) {
      console.log();
      let model = {};
      if (this.carTabId === "2") {
        model = {
          brandId: args[0]
        };
      } else if (this.carTabId === "3") {
        model = {
          brandId: args[0],
          seriesId: args[1]
        };
      }

      RoundApi.getBsmList(this, model).then(res => {
        if (res.retCode) {
          if (this.carTabId === "1") {
            this.bsmList = res.data[1];
            Object.assign(this.selectBrandList, this.bsmList);
            for (let n in this.selectBrandList) {
              this.selectBrandList[n] = true;
            }
            this.isSelectAll = true;
          } else if (this.carTabId === "2") {
            this.bsmSeriesList = res.data;
          } else if (this.carTabId === "3") {
            this.bsmAutomobileList = res.data;
            this.classifyContent = this.bsmAutomobileList[this.classifySeleted];
          }
        } else {
        }
      });
    },

    queryRecordList(row) {
      console.log("获取维修列表");
      this.recordModel = !this.recordModel;
      this.userId = row.userId;
      this.getRecordList();
    },
    getRecordList() {
      let model = {
        userId: this.userId,
        page: this.recordPage,
        pageSize: 10
      };

      RoundApi.getRecordList(this, model).then(res => {
        if (res.retCode) {
          this.recordList = res.data.list;
          this.recordPageCount = res.data.page.total;
        }
      });
    },
    doblockStatus(row) {
      let model = {
        userIds: row.userId,
        blockStatus: false
      };
      if (!row.blockStatus) {
        model.blockStatus = true;
      }
      RoundApi.doblockStatus(this, model).then(res => {
        if (res.retCode) {
          this.$message("修改成功");
          //  this.$refs.multipleTable.doLayout();
          this.getUserList();
        } else {
        }
      });
    },
    viewBigIcon(url) {
      this.bigIcon = url;
      this.viewBig = true;
    },
    handleCurrentTranChange(val) {
      console.log(val);
      this.tranPageIndex = val;
      this.queryMoneyModelList({ userId: this.moneyModelForm.userId });
    },
    queryMoneyModel(row) {
      this.tranPageIndex = 1;
      this.moneyModel = !this.moneyModel;
      this.moneyModelForm.userId = row.userId;
      this.queryMoneyModelList({ userId: row.userId });
    },
    queryMoneyModelList(row) {
      //分页 2个参数
      let pageSize = 10; //每页显示多少条记录。
      let pageIndex = this.tranPageIndex - 1; //第几页.

      //limit 计算.
      // let begin = pageIndex;
      //这里替换上面的 用于分页。

      this.moneyModelForm.pageSize = pageSize;
      this.moneyModelForm.page = pageIndex;
      this.moneyModelForm.userId = row.userId;
      RoundApi.getMoneyModel(this, this.moneyModelForm).then(res => {
        if (res.retCode) {
          this.tableData = res.data.transactionLogList;
          this.tranCount = res.data.page.total;
        } else {
        }
      });
    },
    handleStatus(row) {
      switch (row) {
        case "USER_UNCHECK":
          return "等待审核";
        case "USER_CHECK_FAILED":
          return "已冻结";
        case "USER_CHECK_SUCCEED":
          return "审核成功";
      }
    },
    saveStatus() {
      let userIds = [];
      this.userIdList.forEach((item, index) => {
        userIds.push(item.userId);
      });
      RoundApi.updateUserStatus(this, {
        userIds: userIds.join(","),
        userStatus: this.statusForm.userStatus
      }).then(res => {
        console.log("2222");
        if (res.retCode) {
          this.$message("修改成功");
          this.getUserList();
          this.statusModel = !this.statusModel;
        } else {
        }
      });
    },
    save() {
      let userIds = [];
      this.userIdList.forEach((item, index) => {
        userIds.push(item.userId);
      });
      RoundApi.userIndexPrice(this, {
        userIds: userIds.join(","),
        userType: this.form.userStar
      }).then(res => {
        if (res.retCode) {
          this.$message("修改成功");
          this.getUserList();
          this.editModel = !this.editModel;
        } else {
        }
      });
    },
    handleRole(row) {
    	console.log(this.liyangDatasource )
      if (!row) {
        return "";
      } else {
        switch (row) {
          case "OWNER":

            return  this.liyangDatasource==true ? "会员" : "车主";
          case "PARTS":
            return this.liyangDatasource==true ? "代理" : "配件商";
          case "REPAIR":
            return this.liyangDatasource==true ? "维修厂" : this.qds_flag ? '服务商' : "修理厂";
          case "REPAIRMAN": 
          	return this.qds_flag ? '技师' : '修理工'
        }
      }
    },
    handleLabel(sort) {
      if (!this.priceModel) {
        return "";
      } else {
        switch (sort) {
          case 1:
            return this.priceModel.star1Name;
          case 2:
            return this.priceModel.star2Name;
          case 3:
            return this.priceModel.star3Name;
          case 4:
            return this.priceModel.star4Name;
          case 5:
            return this.priceModel.star5Name;
        }
      }
    },
    changeModel() {
      if (this.userIdList.length > 0) {
        this.editModel = !this.editModel;
      } else {
        this.$message({
          message: "请选择一个或一个以上的会员",
          type: "warning"
        });
      }
    },
    setKeyIds(val) {
      console.log(val);
      this.userIdList = val;
      console.log(this.userIdList.length);
    },
    handleCurrentChange(val) {
      console.log(val);
      this.pageIndex = val;
      this.getUserList();
    },
    getList() {
      RoundApi.getDiscountList(this).then(res => {
        if (res.retCode) {
          this.priceModel = res.data;
          console.log(res);
        } else {
        }
      });
    },
    handleType(type) {
      if (!this.priceModel) {
        return type;
      }
      switch (type) {
        case "STAR1":
          return this.priceModel.star1Name;
        case "STAR2":
          return this.priceModel.star2Name;
        case "STAR3":
          return this.priceModel.star3Name;
        case "STAR4":
          return this.priceModel.star4Name;
        case "STAR5":
          return this.priceModel.star5Name;
      }
    },
    getUserList() {
      //分页 2个参数
      let pageSize = 10; //每页显示多少条记录。
      let pageIndex = this.pageIndex - 1; //第几页.

      //limit 计算.
      // let begin = pageIndex;
      //这里替换上面的 用于分页。

      this.form.pageSize = pageSize;
      this.form.page = pageIndex;
      RoundApi.getUserList(this, this.form).then(res => {
        if (res.retCode) {
          console.log("会员列表", res);
          this.userTableData = res.data.userList;
          this.count = res.data.page.total;
        }
      });
    }
  },
  mounted() {
    window.myvue = this;
    

		this.liyangDatasource = window.sessionStorage.getItem('liyangDatasource') ? window.sessionStorage.getItem('liyangDatasource'): false

		console.log('力洋')
		//storage.setItem("merchantId", res.data.merchant.merchantId);
		console.log()
		this.qds_flag = sessionStorage.getItem('merchantId') == 'Mer5b10b6cedb573c72d45b5c03' ? true : false
		console.log(this.qds_flag)
    this.uploadModel.uploadUrl = Config.g_upload_url;
    this.getList();
    this.getUserList();
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style >
.custom.el-dialog__body {
  padding: 0 !important;
}
.custom.el-dialog--center .el-dialog__body {
  padding: 0 !important;
}
.carBar {
  cursor: pointer;
  display: flex;
  font-size: 14px;
  box-sizing: border-box;
  width: 100%;
  z-index: 999;
  border-top: solid #e5e5e5 1px;
  border-left: solid #e5e5e5 1px;
  border-right: solid #e5e5e5 1px;
}

.carBar-items {
  border-bottom: solid #e5e5e5 1px;
  box-sizing: border-box;
  line-height: 1.5;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
}

.carBar-items_select {
  box-sizing: border-box;
  background-color: #fff;
  border: 0;
}
.lineTwo {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.classify-container {
  box-sizing: border-box;
  width: 120px;
  background: #f5f5f5;
  height: 100%;
  overflow: auto;
  border-right: 1px solid #e5e5e5;
}

.classify-container .classify {
  cursor: pointer;
  padding: 15px 10px;
  text-align: center;
  margin-right: -2px;
  /* border-left: #f5f5f5 10px solid; */
  color: #646464;
}

.classify-container .classify.active {
  background: #fff;
  border-right: #fff 1px solid;
}

.classify-container .classify .name {
  display: inline-block;
  font-size: 15px;

  line-height: 1.2;
  text-align: left;
  pointer-events: none;
}

.goods-container {
  -webkit-flex: 1;
  background: #fff;
  height: 100%;

  overflow: auto;
}
.goods-container1 {
  -webkit-overflow-scrolling: touch;
}
.goods-container .title {
  padding: 20px 25px;
  color: #646464;
  font-size: 30px;
  line-height: 30px;
  background: #f7f7f7;
}

.goods-container .goods {
  position: relative;
  padding: 20px 30px;
  font-size: 36px;
  line-height: 40px;
  border-bottom: 1px solid #f7f7f7;
}

.goods-container .goods .pic {
  float: left;
  width: 130px;
  height: 130px;
  margin-right: 20px;
}

.goods-container .goods .name {
  color: #000;
  font-size: 36px;
  line-height: 46px;
}

.goods-container .goods .sold {
  color: #989898;
  font-size: 30px;
  line-height: 46px;
}

.goods-container .goods .price {
  color: #f45044;
  font-size: 36px;
  line-height: 46px;
}

.goods-container .goods .addCart {
  position: absolute;
  right: 30px;
  bottom: 30px;
  width: 80px;
  height: 80px;
  background: #feb70f;
  border-radius: 50%;
}

.goods-container .goods .addCart image {
  pointer-events: none;
  position: absolute;
  left: 25px;
  top: 25px;
  width: 30px;
  height: 30px;
}
.contentBox {
  display: flex;
  margin-left: 10px;
  padding: 0 10px 20px;
  font-size: 12px;
  cursor: pointer;
}
.line {
  text-align: center;
}
.letter {
  font-weight: 600;
  height: 30px;
  width: 30px;
  border: solid 1px #e5e5e5;
  margin: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #666;
  background-color: #f5f5f5;
  cursor: pointer;
}
.inputBox ::-webkit-input-placeholder {
  /* WebKit, Blink, Edge */
  text-align: center;
}
.inputBox :-moz-placeholder {
  /* Mozilla Firefox 4 to 18 */
  text-align: center;
}
.inputBox ::-moz-placeholder {
  /* Mozilla Firefox 19+ */
  text-align: center;
}
.inputBox :-ms-input-placeholder {
  /* Internet Explorer 10-11 */
  text-align: center;
}
.inputBox {
  margin: 10px;
}
.letterBox:hover {
  background-color: #f7f7f7;
}
.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
}

.el-carousel__item:nth-child(2n) {
  background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #d3dce6;
}
.el-table .cell {
  text-align: center;
}
</style>
